 package sza.oracle.apps.ap.oie.webui;
 
 import java.io.PrintStream;
 import java.net.URI;
 import oracle.apps.fnd.common.VersionInfo;
 import oracle.apps.fnd.framework.webui.OAControllerImpl;
 import oracle.apps.fnd.framework.webui.OAPageContext;
 import oracle.apps.fnd.framework.webui.beans.OAWebBean;
 import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
 import oracle.apps.fnd.framework.webui.laf.LafUtils;
 import sza.oracle.apps.ap.oie.oa.webservice.sms.Cmcc_mas_wbsClient;
 import sza.oracle.apps.ap.oie.oa.webservice.sms.types.org.csapi.schema.sms.MessageFormat;
 import sza.oracle.apps.ap.oie.oa.webservice.sms.types.org.csapi.schema.sms.SendMethodType;
 import sza.oracle.apps.ap.oie.oa.webservice.sms.types.org.csapi.schema.sms.SendSmsRequest;
 import sza.oracle.apps.ap.oie.oa.webservice.sms.types.org.csapi.schema.sms.SendSmsResponse;
 import sza.oracle.apps.ap.oie.oa.webservice.todo.TodoBeanServiceClient;
 
 public class HomeCO extends OAControllerImpl
 {
   public static final String RCS_ID = "$Header$";
   public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header$", "%packagename%");
 
   public void processRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     System.out.println("processRequest - start");
     super.processRequest(pageContext, webBean);
 
     if (LafUtils.isPrintableFacet(pageContext))
     {
       OAMessageTextInputBean item1 = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("item1");
 
       if (item1 != null)
       {
         item1.setText("hello world.");
       }
 
     }
 
     System.out.println("processRequest - end");
   }
 
   public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     System.out.println("processFormRequest - start");
     super.processFormRequest(pageContext, webBean);
 
     if ("WebServiceButton".equals(pageContext.getParameter("event")) == true)
     {
       System.out.println("WebServiceButton - start");
       try
       {
         System.out.println("WebServiceButton - try - start");
 
         TodoBeanServiceClient todoBeanServiceClient = new TodoBeanServiceClient();
 
         String taskid = "123";
         String processid = "123";
         String flow_type = "123";
         String title = "Test";
         String executor = "A06085";
         String todo_flag = "0";
         String url = "http:";
         String instid = "CWJY";
 
         Integer WebServiceInvokeResult = Integer.valueOf(0);
 
         WebServiceInvokeResult = Integer.valueOf(todoBeanServiceClient.saveTodoData(taskid, processid, flow_type, title, executor, todo_flag, url, instid));
 
         System.out.println("WebServiceInvokeResult = " + WebServiceInvokeResult.toString());
 
         System.out.println("WebServiceButton - try - end");
       }
       catch (Exception e)
       {
         System.out.println("WebServiceButton - exception - start");
 
         System.out.println("WebServiceButton - exception - end");
       }
 
       System.out.println("WebServiceButton - end");
     }
 
     if ("SendSMS".equals(pageContext.getParameter("event")) == true)
     {
       System.out.println("SendSMS - start");
       try
       {
         System.out.println("SendSMS - try - start");
 
         Cmcc_mas_wbsClient cmcc_mas_wbsClient = new Cmcc_mas_wbsClient();
 
         SendSmsRequest sendSmsRequest = new SendSmsRequest();
         sendSmsRequest.setApplicationID("499");
         sendSmsRequest.setDeliveryResultRequest(true);
         URI[] mobile = new URI[1];
         mobile[0] = new URI("tel:13923863936");
 
         sendSmsRequest.setDestinationAddresses(mobile);
         sendSmsRequest.setExtendCode("499");
         sendSmsRequest.setMessage("1#AL_testè™šæ‹Ÿè®¾å¤‡");
         sendSmsRequest.setMessageFormat(MessageFormat.GB2312);
         sendSmsRequest.setSendMethod(SendMethodType.Normal);
         sendSmsRequest.setUsername("asapi");
         sendSmsRequest.setPassword("asapi");
         sendSmsRequest.setPassageWay("1");
         sendSmsRequest.setDeptNo("admin");
         sendSmsRequest.setEmpNo("admin");
         sendSmsRequest.setIsMain("1");
 
         SendSmsResponse sendSmsResponse = cmcc_mas_wbsClient.sendSms(sendSmsRequest);
 
         System.out.println("sendSmsResponse.getRequestIdentifier() = " + sendSmsResponse.getRequestIdentifier().toString());
 
         System.out.println("SendSMS - try - end");
       }
       catch (Exception e)
       {
         System.out.println("SendSMS - exception - start");
         System.out.println("SendSMS - exception :" + e.toString());
         e.printStackTrace();
         System.out.println("SendSMS - exception - end");
       }
 
       System.out.println("SendSMS - end");
     }
 
     if ("UpdateTestWebService".equals(pageContext.getParameter("event")) == true)
     {
       System.out.println("UpdateTestWebService - start");
       try
       {
         System.out.println("UpdateTestWebService - try - start");
         TodoBeanServiceClient todoBeanServiceClient = new TodoBeanServiceClient();
 
         String taskid = "123";
         String processid = "123";
         String instid = "CWJY";
         String todo_flag = "1";
 
         Integer WebServiceInvokeResult = Integer.valueOf(0);
 
         WebServiceInvokeResult = Integer.valueOf(todoBeanServiceClient.updateTodoFlag(taskid, processid, instid, todo_flag));
 
         System.out.println("WebServiceInvokeResult = " + WebServiceInvokeResult.toString());
 
         System.out.println("UpdateTestWebService - try - end");
       }
       catch (Exception e)
       {
         System.out.println("UpdateTestWebService - exception start");
         System.out.println("SendSMS - exception :" + e.toString());
         System.out.println("UpdateTestWebService - exception end");
       }
 
       System.out.println("UpdateTestWebService - end");
     }
 
     System.out.println("processFormRequest - end");
   }
 }



